<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

<ui:composition template="../templates/popup.xhtml">
	<ui:define name="popup_page">
		<h:form id="sort_form">
			<h:panelGrid width="100%" border="0" columnClasses="_center">
				<a4j:outputPanel id="sort_panel">
					<h:panelGrid columns="2" columnClasses="_left, _right"
						style="width:100%" border="0">
						<h:panelGroup>
							<h:outputText value="#{lbl['hub.rail.num']}" /> : 
			 			<h:outputText value="#{hubManaged.currentRail.number}" />&nbsp;
						<h:outputText value="#{hubManaged.currentRail.destinationLabel}"
								rendered="#{hubManaged.currentRail.typeBundle.id == 2}" />
							<h:outputText value="#{hubManaged.currentRail.typeBundle.label}"
								rendered="#{hubManaged.currentRail.typeBundle.id != 2}" />
						</h:panelGroup>

						<h:panelGrid columns="11" border="0" style="float: right;"
							columnClasses="_left,_left,_right, _right__right, _right_, right, _right, _right,_right,_right">

							<h:outputText value="#{lbl['rail.available']}" />
							<h:selectOneMenu id="available"
								onchange="updateRailAvailable(this.value);"
								value="#{hubManaged.currentRail.available}">
								<f:selectItem itemLabel="#{lbl['common.yes']}" itemValue="true" />
								<f:selectItem itemLabel="#{lbl['common.no']}" itemValue="false" />
							</h:selectOneMenu>

							<h:graphicImage value="../../imgs/spacer_10x1.gif" />

							<h:outputText value="#{lbl['hub.move.wagons']}" />
							<a4j:commandLink rendered="#{hubManaged.currentRail.available}"
								action="#{hubManaged.initUpdateWagons}"
								render="move_wagons_popup"
								oncomplete="#{rich:component('move_wagons_popup')}.show();">
								<!-- Uniquement pour les voies disponibles. -->
								<h:graphicImage value="../../imgs/icons/ico_move.png" width="20" />
							</a4j:commandLink>

							<h:graphicImage value="../../imgs/icons/ico_move_disabled.png"
								width="20" rendered="#{!hubManaged.currentRail.available}" />

							<h:graphicImage value="../../imgs/spacer_10x1.gif" />

							<h:outputText value="#{lbl['hub.add.loco']}" />
							<a4j:commandLink action="#{hubManaged.createNewWagon}"
								render="edit_loco_popup"
								rendered="#{hubManaged.currentRail.available}"
								oncomplete="#{rich:component('edit_loco_popup')}.show();">
								<!-- Uniquement pour les voies disponibles. -->
								<h:graphicImage value="../../imgs/icons/ico_create.png"
									width="20" />
							</a4j:commandLink>

							<h:graphicImage value="../../imgs/icons/ico_create_disabled.png"
								width="20" rendered="#{!hubManaged.currentRail.available}" />

							<h:graphicImage value="../../imgs/spacer_10x1.gif" />

							<h:outputText value="#{lbl['hub.add.wagon']}" />
							<a4j:commandLink action="#{hubManaged.createNewWagon}"
								render="edit_wagon_popup"
								rendered="#{hubManaged.currentRail.available}"
								oncomplete="#{rich:component('edit_wagon_popup')}.show();">
								<!-- Uniquement pour les voies disponibles. -->
								<h:graphicImage value="../../imgs/icons/ico_create.png"
									width="20" />
							</a4j:commandLink>

							<h:graphicImage value="../../imgs/icons/ico_create_disabled.png"
								width="20" rendered="#{!hubManaged.currentRail.available}" />

						</h:panelGrid>
					</h:panelGrid>

					<rich:extendedDataTable id="sort_table"
						style="width:940px;height:580px;border:none;"
						rowClasses="rich_datagrid_even_line, rich_datagrid_odd_line"
						value="#{hubManaged.currentRail.lstWagons}" var="wagon"
						iterationStatusVar="it">

						<f:facet name="noData">
							<h:outputText value="#{msg['msg.info.nodata']}" />
						</f:facet>

						<rich:column width="70px" style="text-align:center;">
							<f:facet name="header">
								<h:outputText value="#{lbl['common.position']}" />
							</f:facet>
							<h:outputText value="#{wagon.currentPos.posNum + 1}" />
						</rich:column>

						<rich:column width="100px" style="text-align:center;"
							styleClass="wagon_sort_#{wagon.currentPos.posReal}">
							<f:facet name="header">
								<h:outputText value="#{lbl['common.wagon']}" />
							</f:facet>
							<h:outputText value="#{wagon.extId}">
								<f:converter converterId="extIdWagonConverter" />
							</h:outputText>
						</rich:column>

						<rich:column width="150px" style="text-align:left;">
							<f:facet name="header">
								<h:outputText value="#{lbl['common.wagon.status']}" />
							</f:facet>
							<h:outputText value="#{wagon.currentStatus.label}" />
						</rich:column>

						<rich:column width="150px" style="text-align:left;">
							<f:facet name="header">
								<h:outputText value="#{lbl['rail.destination.only']}" />
							</f:facet>
							<h:outputText value="#{wagon.destinationLabel}"
								rendered="#{wagon.destinationId ne 1}" />
							<h:outputText value="#{lbl['common.nc']}"
								rendered="#{wagon.destinationId == 1}" />
						</rich:column>

						<rich:column width="330px" style="text-align:left;">
							<f:facet name="header">
								<h:outputText value="#{lbl['common.comment']}" />
							</f:facet>
							<h:outputText value="#{wagon.comment}" />
						</rich:column>

						<rich:column width="60px" style="text-align:center;">
							<f:facet name="header">
								<h:outputText value="#{lbl['common.update']}" />
							</f:facet>
							<a4j:commandLink execute="@this" render="edit_popup"
								oncomplete="#{rich:component('edit_popup')}.show();"
								rendered="#{wagon.currentPos.posReal and hubManaged.currentRail.available}">
								<h:graphicImage value="../../imgs/icons/ico_update.png"
									width="20" />
								<f:setPropertyActionListener target="#{hubManaged.currentWagon}"
									value="#{wagon}" />
							</a4j:commandLink>

							<h:graphicImage value="../../imgs/icons/ico_update_disabled.png"
								width="20"
								rendered="#{!wagon.currentPos.posReal or !hubManaged.currentRail.available}" />
						</rich:column>

						<rich:column width="70px" style="text-align:center;">
							<f:facet name="header">
								<h:outputText value="#{lbl['common.delete']}" />
							</f:facet>
							<a4j:commandLink execute="@this" render="confirm_del_popup"
								action="#{hubManaged.checkWagonNotInFormationPlan}"
								oncomplete="#{rich:component('confirm_del_popup')}.show();"
								rendered="#{wagon.currentPos.posReal}">
								<h:graphicImage value="../../imgs/icons/ico_delete.png"
									width="20" />
								<f:setPropertyActionListener target="#{hubManaged.currentWagon}"
									value="#{wagon}" />
							</a4j:commandLink>

							<h:graphicImage value="../../imgs/icons/ico_delete_disabled.png"
								width="20" rendered="#{!wagon.currentPos.posReal}" />
						</rich:column>
					</rich:extendedDataTable>
				</a4j:outputPanel>

				<!-- Le panneau pour les boutons. -->
				<a4j:commandButton value="#{lbl['common.button.close']}"
					action="#{hubManaged.refreshHub}" immediate="true"
					oncomplete="parent.sort.hide();return false;">
					<a4j:param name="fromOutcome" value="null"
						assignTo="#{hubManaged.criterion.fromOutCome}" />
				</a4j:commandButton>
			</h:panelGrid>

			<!-- ******************************************************** -->
			<!-- Méthode pour le contrôle de la disponibilité de la voie. -->
			<a4j:jsFunction name="updateRailAvailable" execute="@this"
				oncomplete="parent.refreshHub();" render="sort_panel"
				action="#{hubManaged.updateRailAvailable}">
				<a4j:param name="typeCheckRail"
					assignTo="#{hubManaged.criterion.railAvailable}" />
			</a4j:jsFunction>
		</h:form>

		<!-- ******************************************** -->
		<!-- Popup pour modification wagon / loco         -->
		<h:form id="edit_wagon_form">
			<rich:popupPanel id="edit_popup" headerClass="rich_panel_popup_head"
				domElementAttachment="parent" header="#{lbl['rail.edit.wagon']}"
				autosized="true">
				<h:panelGrid styleClass="panel" border="0" id="edit_panel">

					<rich:messages />
					<h:panelGrid columns="2" width="400" rowClasses="panel_row"
						columnClasses="_left_top, _left">

						<h:panelGroup>
							<h:outputText value="#{lbl['common.wagon']}" /> : 
					</h:panelGroup>

						<h:outputText value="#{hubManaged.currentWagon.extId}"
							style="font-weight:bold;">
							<f:converter converterId="extIdWagonConverter" />
						</h:outputText>

						<h:panelGroup>
							<h:outputText value="#{lbl['common.position']}" /> : 
						</h:panelGroup>

						<h:selectOneMenu value="#{hubManaged.currentWagon.nextPos.posNum}">
							<f:selectItems value="#{repositoryManaged.lstPositions}" />
							<f:validator validatorId="selectPositionRequiredValidator" />
							<f:attribute name="fieldName" value="#{lbl['common.position']}" />
						</h:selectOneMenu>

						<h:panelGroup>
							<h:outputText value="#{lbl['hub.rail']}" /> : 
						</h:panelGroup>

						<h:selectOneMenu
							value="#{hubManaged.currentWagon.nextPos.posRailId}">
							<f:selectItems value="#{repositoryManaged.lstAllRails}" />
							<f:validator validatorId="selectRequiredValidator" />
							<f:attribute name="fieldName" value="#{lbl['hub.rail']}" />
						</h:selectOneMenu>

						<h:panelGroup>
							<h:outputText value="#{lbl['common.wagon.status']}" /> : 
						</h:panelGroup>

						<h:selectOneMenu id="statusWagonId" style="width:160px"
							value="#{hubManaged.currentWagon.nextStatus.id}"
							rendered="#{hubManaged.currentWagon.type.trailer}">
							<f:selectItems value="#{repositoryManaged.lstWagonStatus}" />
							<f:validator validatorId="selectRequiredValidator" />
							<f:attribute name="fieldName"
								value="#{lbl['common.wagon.status']}" />
						</h:selectOneMenu>

						<h:selectOneMenu id="statusLocoId"
							value="#{hubManaged.currentWagon.nextStatus.id}"
							style="width:160px"
							rendered="#{!hubManaged.currentWagon.type.trailer}">
							<f:selectItems value="#{repositoryManaged.lstLocoStatus}" />
							<f:validator validatorId="selectRequiredValidator" />
							<f:attribute name="fieldName"
								value="#{lbl['common.wagon.status']}" />
						</h:selectOneMenu>

						<h:panelGroup>
							<h:outputText value="#{lbl['common.comment']}" /> : 
						</h:panelGroup>

						<h:inputTextarea id="wagonComment"
							value="#{hubManaged.currentWagon.comment}" cols="60" rows="10" />
					</h:panelGrid>
				</h:panelGrid>

				<!-- Le panneau pour les boutons. -->
				<h:panelGrid columns="2" id="edit_command_panel"
					columnClasses="_left,_right" style="width:100%">

					<a4j:commandButton value="#{lbl['common.button.cancel']}"
						action="#{hubManaged.refreshHub}"
						oncomplete="#{rich:component('edit_popup')}.hide();return false;">
						<a4j:param name="fromOutcome" value="null"
							assignTo="#{hubManaged.criterion.fromOutCome}" />
					</a4j:commandButton>

					<a4j:commandButton value="#{lbl['common.button.validate']}"
						render="sort_panel" action="#{hubManaged.updateWagon}"
						oncomplete="if ('#{hubManaged.maximumSeverity}'=='INFO')
						{#{rich:component('edit_popup')}.hide();parent.refreshHub();}" />
				</h:panelGrid>
			</rich:popupPanel>
		</h:form>

		<!-- ******************************************** -->
		<!-- Popup pour la suppression d'un wagon / loco. -->
		<h:form id="del_wagon_form">
			<rich:popupPanel id="confirm_del_popup" domElementAttachment="parent"
				headerClass="rich_panel_popup_head" header="#{lbl['wagon.confirm']}"
				autosized="true">
				<h:panelGrid styleClass="panel" border="0" id="del_panel">

					<rich:messages />

					<h:panelGroup>
						<h:outputText value="#{msg['msg.confirm.wagon.delete']}" /> : 
					<h:outputText value="#{hubManaged.currentWagon.extId}">
							<f:converter converterId="extIdWagonConverter" />
						</h:outputText> ?	
				</h:panelGroup>
					<h:panelGrid columns="2" columnClasses="_left, _right" width="100%"
						style="margin-top:20px">
						<a4j:commandButton id="wagon_b_cancel_delete"
							value="#{lbl['common.button.cancel']}"
							onclick="#{rich:component('confirm_del_popup')}.hide(); return false;" />

						<a4j:commandButton id="wagon_b_delete"
							action="#{hubManaged.deleteWagon}" render="sort_panel"
							execute="@this" value="#{lbl['common.button.delete']}"
							oncomplete="#{rich:component('confirm_del_popup')}.hide();parent.refreshHub();" />
					</h:panelGrid>
				</h:panelGrid>
			</rich:popupPanel>
		</h:form>

		<!-- ************************************ -->
		<!-- Popup pour l'ajout d'une locomotive. -->
		<h:form id="add_loco_form">
			<rich:popupPanel id="edit_loco_popup" domElementAttachment="parent"
				autosized="true" headerClass="rich_panel_popup_head"
				onshow="makeFocusOnField('add_loco_form:locoExtId');">
				<f:facet name="header">
					<h:outputText value="#{lbl['hub.add.loco.rail']}" /> : 
					<h:outputText value="#{hubManaged.currentRail.number}" />&nbsp;
					<h:outputText value="#{hubManaged.currentRail.destinationLabel}"
						rendered="#{hubManaged.currentRail.typeBundle.id == 2}" />
					<h:outputText value="#{hubManaged.currentRail.typeBundle.label}"
						rendered="#{hubManaged.currentRail.typeBundle.id != 2}" />
				</f:facet>

				<rich:messages />

				<h:panelGrid columns="2" width="400" rowClasses="panel_row">
					<h:panelGroup>
						<h:outputText value="#{lbl['hub.add.wagon.id']}" /> : 
						</h:panelGroup>
					<h:inputText id="locoExtId" size="20" maxlength="12"
						required="true" onkeypress="return checkNumber(this);"
						requiredMessage="#{err['new.wagon.extid.required']}"
						value="#{hubManaged.currentWagon.extId}" />

					<h:panelGroup>
						<h:outputText value="#{lbl['hub.add.wagon.owner']}" /> : 
						</h:panelGroup>
					<h:inputText id="locoOwner"
						value="#{hubManaged.currentWagon.owner}" size="20" maxlength="50"
						required="true"
						requiredMessage="#{err['new.wagon.owner.required']}">
						<f:validator validatorId="stringValidator" />
						<f:attribute name="fieldName"
							value="#{lbl['hub.add.wagon.owner']}" />
					</h:inputText>

					<h:panelGroup>
						<h:outputText value="#{lbl['hub.add.wagon.type']}" /> : 
						</h:panelGroup>
					<h:selectOneMenu id="locoType"
						value="#{hubManaged.currentWagon.type.id}">
						<f:selectItems value="#{repositoryManaged.lstLocoTypes}" />
						<f:validator validatorId="selectRequiredValidator" />
						<f:attribute name="fieldName" value="#{lbl['hub.add.wagon.type']}" />
					</h:selectOneMenu>

					<h:panelGroup>
						<h:outputText value="#{lbl['common.wagon.status']}" /> : 
						</h:panelGroup>
					<h:selectOneMenu id="locoStatusId"
						value="#{hubManaged.currentWagon.nextStatus.id}">
						<f:selectItems value="#{repositoryManaged.lstLocoStatus}" />
						<f:validator validatorId="selectRequiredValidator" />
						<f:attribute name="fieldName"
							value="#{lbl['common.wagon.status']}" />
					</h:selectOneMenu>

					<h:panelGroup>
						<h:outputText value="#{lbl['hub.add.loco.fuel']}" /> : 
						</h:panelGroup>
					<h:inputText id="locoFuel" maxlength="5"
						value="#{hubManaged.currentWagon.fuelLevel}" size="20">
						<f:validator validatorId="stringNumberValidator" />
						<f:attribute name="fieldName" value="#{lbl['hub.add.loco.fuel']}" />
					</h:inputText>

					<h:panelGroup>
						<h:outputText value="#{lbl['common.position']}" /> :
						</h:panelGroup>
					<h:selectOneMenu id="locoNextPosNum"
						value="#{hubManaged.currentWagon.nextPos.posNum}">
						<f:selectItems value="#{repositoryManaged.lstPositions}" />
					</h:selectOneMenu>
				</h:panelGrid>

				<!-- Le panneau pour les boutons. -->
				<h:panelGrid columns="2" id="add_loco_command_panel"
					columnClasses="_left,_right" style="width:100%">

					<a4j:commandButton value="#{lbl['common.button.cancel']}"
						action="#{hubManaged.refreshHub}"
						oncomplete="#{rich:component('edit_loco_popup')}.hide();return false;">
						<a4j:param name="fromOutcome" value="null"
							assignTo="#{hubManaged.criterion.fromOutCome}" />
					</a4j:commandButton>

					<a4j:commandButton value="#{lbl['common.button.validate']}"
						action="#{hubManaged.addLocomotive}" render="sort_panel"
						oncomplete="if ('#{hubManaged.maximumSeverity}'=='INFO')
						{#{rich:component('edit_loco_popup')}.hide();parent.refreshHub();}" />
				</h:panelGrid>
			</rich:popupPanel>
		</h:form>

		<!-- ****************************** -->
		<!-- Popup pour l'ajout d'un wagon. -->
		<h:form id="add_wagon_form">
			<rich:popupPanel id="edit_wagon_popup" domElementAttachment="parent"
				autosized="true" headerClass="rich_panel_popup_head"
				onshow="makeFocusOnField('add_wagon_form:wagonExtId');">

				<f:facet name="header">
					<h:outputText value="#{lbl['hub.add.wagon.rail']}" /> : 
					<h:outputText value="#{hubManaged.currentRail.number}" />&nbsp;
					<h:outputText value="#{hubManaged.currentRail.destinationLabel}"
						rendered="#{hubManaged.currentRail.typeBundle.id == 2}" />
					<h:outputText value="#{hubManaged.currentRail.typeBundle.label}"
						rendered="#{hubManaged.currentRail.typeBundle.id != 2}" />
				</f:facet>

				<rich:messages />

				<h:panelGrid columns="2" width="400" rowClasses="panel_row">
					<h:panelGroup>
						<h:outputText value="#{lbl['hub.add.wagon.id']}" /> : 
						</h:panelGroup>
					<h:inputText id="wagonExtId" size="20" maxlength="12"
						required="true" onkeypress="return checkNumber(this);"
						requiredMessage="#{err['new.wagon.extid.required']}"
						value="#{hubManaged.currentWagon.extId}" />

					<h:panelGroup>
						<h:outputText value="#{lbl['hub.add.wagon.owner']}" /> : 
						</h:panelGroup>
					<h:inputText id="wagonOwner"
						value="#{hubManaged.currentWagon.owner}" size="20" maxlength="50"
						required="true"
						requiredMessage="#{err['new.wagon.owner.required']}">
						<f:validator validatorId="stringValidator" />
						<f:attribute name="fieldName"
							value="#{lbl['hub.add.wagon.owner']}" />
					</h:inputText>

					<h:panelGroup>
						<h:outputText value="#{lbl['hub.add.wagon.type']}" /> : 
						</h:panelGroup>
					<h:selectOneMenu id="wagonType"
						value="#{hubManaged.currentWagon.type.id}">
						<f:selectItems value="#{repositoryManaged.lstWagonTypes}" />
						<f:validator validatorId="selectRequiredValidator" />
						<f:attribute name="fieldName" value="#{lbl['hub.add.wagon.type']}" />
					</h:selectOneMenu>

					<h:panelGroup>
						<h:outputText value="#{lbl['common.wagon.status']}" /> : 
						</h:panelGroup>
					<h:selectOneMenu id="wagonStatusId"
						value="#{hubManaged.currentWagon.nextStatus.id}">
						<f:selectItems value="#{repositoryManaged.lstWagonStatus}" />
						<f:validator validatorId="selectRequiredValidator" />
						<f:attribute name="fieldName"
							value="#{lbl['common.wagon.status']}" />
					</h:selectOneMenu>

					<h:panelGroup>
						<h:outputText value="#{lbl['hub.add.wagon.riv']}" /> : 
						</h:panelGroup>
					<h:selectOneMenu id="wagonRiv"
						value="#{hubManaged.currentWagon.riv}">
						<f:selectItems value="#{repositoryManaged.lstWagonRiv}" />
						<f:validator validatorId="selectRequiredValidator" />
						<f:attribute name="fieldName" value="#{lbl['hub.add.wagon.riv']}" />
					</h:selectOneMenu>

					<h:panelGroup>
						<h:outputText value="#{lbl['hub.add.wagon.lading']}" /> : 
						</h:panelGroup>
					<h:selectOneMenu id="wagonLading"
						value="#{hubManaged.currentWagon.lading}">
						<f:selectItems value="#{repositoryManaged.lstWagonLading}" />
						<f:validator validatorId="selectRequiredValidator" />
						<f:attribute name="fieldName"
							value="#{lbl['hub.add.wagon.lading']}" />
					</h:selectOneMenu>

					<h:panelGroup>
						<h:outputText value="#{lbl['hub.add.wagon.weight.lading']}" /> : 
						</h:panelGroup>
					<h:inputText id="wagonWeightLading"
						onkeypress="return checkNumber(this);"
						value="#{hubManaged.currentWagon.weightLading}" size="20"
						maxlength="10">
					</h:inputText>

					<h:panelGroup>
						<h:outputText value="#{lbl['hub.add.wagon.destination']}" /> : 
						</h:panelGroup>
					<h:selectOneMenu id="wagonDestinationId"
						value="#{hubManaged.currentWagon.destinationId}">
						<f:selectItems value="#{repositoryManaged.lstDestinations}" />
					</h:selectOneMenu>

					<h:panelGroup>
						<h:outputText value="#{lbl['common.position']}" /> :
						</h:panelGroup>
					<h:selectOneMenu id="wagonNextPosNum"
						value="#{hubManaged.currentWagon.nextPos.posNum}">
						<f:selectItems value="#{repositoryManaged.lstPositions}" />
					</h:selectOneMenu>
				</h:panelGrid>

				<!-- Le panneau pour les boutons. -->
				<h:panelGrid columns="2" id="add_wagon_command_panel"
					columnClasses="_left,_right" style="width:100%">

					<a4j:commandButton value="#{lbl['common.button.cancel']}"
						action="#{hubManaged.refreshHub}"
						oncomplete="#{rich:component('edit_wagon_popup')}.hide();return false;">
						<a4j:param name="fromOutcome" value="null"
							assignTo="#{hubManaged.criterion.fromOutCome}" />
					</a4j:commandButton>

					<a4j:commandButton value="#{lbl['common.button.validate']}"
						action="#{hubManaged.addWagon}" render="sort_panel"
						oncomplete="if ('#{hubManaged.maximumSeverity}'=='INFO')
						{#{rich:component('edit_wagon_popup')}.hide();parent.refreshHub();}" />
				</h:panelGrid>
			</rich:popupPanel>
		</h:form>

		<!-- ************************************ -->
		<!-- Popup pour déplacer plusieurs wagon. -->
		<h:form id="move_wagons_form">
			<rich:popupPanel id="move_wagons_popup" domElementAttachment="parent"
				autosized="true" headerClass="rich_panel_popup_head"
				onshow="makeFocusOnField('move_wagons_form:nbWagonStack');">

				<f:facet name="header">
					<h:outputText value="#{lbl['hub.move.wagons']}" />
				</f:facet>

				<rich:messages />
				<h:panelGrid style="width:400px;" columns="2" border="0"
					columnClasses="_left, _left" rowClasses="panel_row">
					<h:panelGroup>
						<h:outputText value="#{lbl['hub.move.nb.wagons']}" /> : 
					</h:panelGroup>

					<h:inputText id="nbWagonStack"
						onkeypress="return checkNumber(this)" required="true"
						requiredMessage="#{err['nb.wagons.required']}"
						value="#{hubManaged.criterion.nbWagonStack}" maxlength="2"
						size="2" />

					<h:panelGroup>
						<h:outputText value="#{lbl['hub.rail.num']}" /> : 
					</h:panelGroup>

					<h:selectOneMenu value="#{hubManaged.criterion.posRailId}">
						<f:selectItems value="#{repositoryManaged.lstAllRails}" />
						<f:validator validatorId="selectRequiredValidator" />
						<f:attribute name="fieldName" value="#{lbl['hub.rail']}" />
					</h:selectOneMenu>

					<h:panelGroup>
						<h:outputText value="#{lbl['common.wagon.status']}" /> :
					</h:panelGroup>

					<h:selectOneMenu id="statusWagonsId" style="width:160px"
						value="#{hubManaged.criterion.statusId}">
						<f:selectItems value="#{repositoryManaged.lstWagonStatus}" />
						<f:validator validatorId="selectRequiredValidator" />
						<f:attribute name="fieldName"
							value="#{lbl['common.wagon.status']}" />
					</h:selectOneMenu>
				</h:panelGrid>


				<!-- Le panneau pour les boutons. -->
				<h:panelGrid columns="2" id="move_wagons_command_panel"
					columnClasses="_left,_right" style="width:100%">

					<a4j:commandButton value="#{lbl['common.button.cancel']}"
						action="#{hubManaged.refreshHub}"
						oncomplete="#{rich:component('move_wagons_popup')}.hide();return false;">
						<a4j:param name="fromOutcome" value="null"
							assignTo="#{hubManaged.criterion.fromOutCome}" />
					</a4j:commandButton>

					<a4j:commandButton value="#{lbl['common.button.validate']}"
						action="#{hubManaged.updateWagons}" render="sort_panel"
						oncomplete="if ('#{hubManaged.maximumSeverity}'=='INFO')
						{#{rich:component('move_wagons_popup')}.hide();parent.refreshHub();}" />
				</h:panelGrid>
			</rich:popupPanel>
		</h:form>

	</ui:define>
</ui:composition>
</html>